home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlIpAddressSetFocus.au3 < prev    next >
Text File  |  2007-09-08  |  834b  |  39 lines

  1. #include <GuiIPAddress.au3>
  2.  
  3. Opt("MustDeclareVars", 1)
  4.  
  5. _Main()
  6.  
  7. Func _Main()
  8.     Local $msg, $hgui, $setfocus, $button, $hIPAddress
  9.     Local $index = 1
  10.     
  11.     $hgui = GUICreate("IP Address Control Create Example", 300, 150)
  12.     
  13.     $hIPAddress = _GUICtrlIpAddressCreate ($hgui, 10, 10, 125, 30, $WS_THICKFRAME)
  14.     
  15.     $setfocus = GUICtrlCreateButton("Set Focus", 10, 50, 80, 20)
  16.     
  17.     $button = GUICtrlCreateButton("Exit", 100, 100, 100, 25)
  18.     
  19.     _GUICtrlIpAddressSet ($hIPAddress, "24.168.2.128")
  20.     GUISetState(@SW_SHOW)
  21.     
  22.     While 1
  23.         $msg = GUIGetMsg()
  24.         
  25.         Select
  26.             
  27.             Case $msg = $GUI_EVENT_CLOSE Or $msg = $button
  28.                 Exit
  29.             Case $msg = $setfocus
  30.                 _GUICtrlIpAddressSetFocus ($hIPAddress, $index)
  31.                 If $index < 3 Then
  32.                     $index += 1
  33.                 Else
  34.                     $index = 0
  35.                 EndIf
  36.         EndSelect
  37.     WEnd
  38. EndFunc   ;==>_Main
  39.